import { Modal } from 'antd';
import ExclamationCircleOutlined from '@ant-design/icons/ExclamationCircleOutlined';

export default function confirm(title: string, content: string) {
	return new Promise<boolean>((res, rej) => {
		Modal.confirm({
			title,
			icon: <ExclamationCircleOutlined />,
			content,
			okText: '确认',
			cancelText: '取消',
			maskClosable: true,
			onOk() {
				res(true);
			},
			onCancel() {
				res(false);
			}
		});
	});
}
